import AjaxApi from "../../../components/lib/ApiFactory";
export default class SystemParameterAjaxApi {
    static getStoreLevels() {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/store-level/list"
        })();
    }

    static createSystemParam(data) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/",
            contentType: "application/json",
            dataType: "json",
            method: "POST"
        })(data);
    }

    static updateSystemParam(systemParameterId, data) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/" + systemParameterId,
            contentType: "application/json",
            dataType: "json",
            method: "PUT"
        })(data);
    }

    static enableSystemParam(systemParameterId) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/" + systemParameterId + '/enable',
            method: "PUT"
        })();
    }

    static disableSystemParam(systemParameterId) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/" + systemParameterId + '/disable',
            method: "PUT"
        })();
    }

    static deleteSystemParam(systemParameterId) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/" + systemParameterId,
            method: "DELETE",
        })();
    }

    static getSystemParam(systemParameterId) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/" + systemParameterId
        })();
    }

    static getSystemParamTypes() {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/type/list"
        })();
    }

    static getSystemParams(keyword = "", pageNum = 1, pageSize = 20) {
        return AjaxApi({
            url: "/pc/server-api/systemparameter/list"
        })({
            "pageNum": pageNum,
            "pageSize": pageSize,
            "keyword": keyword
        });
    }
}
